float4x4 World;
float4x4 View;
float4x4 Projection;

struct VertexShaderInput
{
    float4 Position : POSITION0;
	float2 TexCoord : TEXCOORD0;	 
};

struct VertexShaderOutput
{
    float4 Position : POSITION0;
	float2 TexCoord : TEXCOORD0; 
};

VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
{
    VertexShaderOutput output;

    float4 worldPosition = mul(input.Position, World);
    float4 viewPosition = mul(worldPosition, View);
    output.Position = mul(viewPosition, Projection);
	output.TexCoord = input.TexCoord;

    return output;
}

float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{

	float4 color = float4( 0.0f, 0.0f, 0.0f, 0.0f );   
   
   int mod = 2;
   int border = 1;
   int factor = 20;

   if(((input.TexCoord.x * factor) % mod) >= border || ((input.TexCoord.y * factor) % mod) >= border)
   {
      if(((input.TexCoord.x * factor) % mod) >= border && ((input.TexCoord.y * factor) % mod) >= border)
      {
         color = float4(1, 1, 1, 1);
      } else
      {   
         color = float4(0, 0, 0, 1);
      }
   } else
   {   
      if(((input.TexCoord.x * factor) % mod) <= border && ((input.TexCoord.y * factor) % mod) <= border)
      {
         color = float4(1, 1, 1, 1);
      } else
      {   
         color = float4(0, 0, 0, 1);
      }
   }

    return color;
}

technique Technique1
{
    pass Pass0
    {
        VertexShader = compile vs_2_0 VertexShaderFunction();
        PixelShader = compile ps_2_0 PixelShaderFunction();
    }
}
